var rAF = function (fn) {
    var ticking = false;
    var update = function (...arg) {
        ticking = false;
        fn.apply(this, arg)
    }
    return function (...arg) {
        let self = this;
        if(!ticking) {
            requestAnimationFrame(function() {
                update.apply(self, arg)
            });
        }
        ticking = true;
    }
}